#!/bin/bash

exitstatus=0
for version in $(<script/TARGETED_VERSIONS); do
  cmd="bundle install && rake"
  echo
  echo -e "\033[1;33m[$version] $cmd\033[0m"
  echo
  export RBENV_VERSION=$version
  eval $cmd
  if [ $? -ne 0 ]; then exitstatus=1; fi
done

if [ $exitstatus -eq 0 ]; then
  echo -e "\033[1;33mTest suite passed!\033[0m"
else
  echo -e "\033[1;33mTest suite failed!\033[0m"
fi
echo
